﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CivLib.CivNum
{
  /// <summary>
  /// Class containg the current unit_system as System
  /// and the constants in that unit system.
  /// </summary>
  public static class Const
  {
    /// <summary>
    /// Enumeration of the possible unit systems
    /// </summary>
    public enum unit_system { 
      /// <summary>The British Gravitational System</summary>
      BG, 
      /// <summary>The Systeme Internacional</summary>
      SI };
    private static unit_system system = unit_system.BG;
    private static bool isBG = true;
    /// <summary>
    /// set to define the system the constants will be from
    /// </summary>
    public static unit_system System
    {
      get { return system; }
      set 
      { 
        system = value;
        isBG = (value == unit_system.BG) ? true : false;
      }
    }

    /// <summary>
    /// double value of the constant PI
    /// </summary>
    public const double PI = 3.1415926535897932384626433832795028841971693993751d;

    /// <summary>
    /// double value of the fraction 1/3
    /// </summary>
    public const double OneThrid = 0.333333333333333333333333333333333333333333333333333d;

    /// <summary>
    /// double value of the fraction 2/3
    /// </summary>
    public const double TwoThrids = 0.66666666666666666666666666666666666666666666666666d;

    /// <summary>
    /// Standard acceleration due to gravity [ft/s^2] [m/s^2]
    /// </summary>
    public static double g
    { get { return isBG ? 32.174d : 9.80665d; } }

    /// <summary>
    /// Mannings adjustment for BG: 1.49 if BG, 1 if SI
    /// </summary>
    public static double Kn
    { get { return isBG ? 1.49d : 1d; } }

    /// <summary>
    /// Specific Weight of water at 5deg [lb/ft^3] [N/m^3]
    /// </summary>
    public static double SW_Wat
    { get { return isBG ? 62.43d : 9807d; } }

  }

}
